package com.zonhar.autofeed.controller;

import com.zonhar.autofeed.common.device.rpi.RpiDeviceUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("hx")
public class Hx711Controller {

    private final static Logger log = LoggerFactory.getLogger(Hx711Controller.class);

    /**
     * 重量传感器测试接口
     * @return
     */
    @GetMapping("/run")
    public String run(){
        return RpiDeviceUtils.getHx711Weight() + "kg";
    }
}
